<%--
    Document   : editObra
    Created on : 11/03/2011, 15:36:13
    Author     : UpTech
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<!-- Declaração das Tags da biblioteca RichFaces -->
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<f:view>
     <style>.cols{
            vertical-align:top;
        }
    </style>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link href="../css/estilomodelo.css" rel="stylesheet" type="text/css" />
        <title> EDIÇÃO DE OBRA | Sistema Gestão de Suprimentos - SGS 1.0</title>
    </head>
<body>
<div id="container">
<div id="banner">
</div><%--Banner--%>
<div  id="conteudoCad">
   <h:form>
    <rich:panel style="width:752px; height:200px; background-color:#EEEEEE;">
        <f:facet name="header">
            <h:outputText value="Edição de Obra"  ></h:outputText>
        </f:facet>
         <h:panelGrid columns="3">
              <h:outputText value="Contrato: "/>
             <rich:comboBox id="contrato"  defaultLabel="Contrato"  value="#{ObjFacadeObra.obra.contrato}" converter="ConverterContratoList" required="true">
                 <f:selectItems value="#{ObjDAO.contratos}"/>
             </rich:comboBox>
            <rich:message for="funcionario"/>

            <h:outputText value="Nome: "/>
            <rich:inplaceInput id="nome" value="#{ObjFacadeObra.obra.nome}" defaultLabel="Nome" required="true" inputWidth="100"/>
            <rich:message for="nome"/>

            <a4j:commandButton value="Alterar" action="#{ObjFacadeObra.alterarObra}" />
            <a4j:commandButton value="Cancelar" action="#{ObjFacadeObra.cancelaObra}" />
        </h:panelGrid>

      </rich:panel>
    </h:form>
</div><%--Conteúdo--%>
<div align="center" id="tableCad">
      <h:form>
          <rich:dataTable style="width:740px;" id="obra" border="1" value="#{ObjDAO.allObra}" rendered="#{not empty ObjDAO.allObra}"  var="o" rows="4">
          <h:column>
              <f:facet name="header">
                  <h:outputText value="Id"/>
              </f:facet>
              <center> <h:outputText value="#{o.idObra}"/></center>
          </h:column>
           <h:column>
              <f:facet name="header">
                  <h:outputText value="Nome"/>
              </f:facet>
               <center> <h:outputText value="#{o.nome}"/></center>
          </h:column>
           <h:column>
              <f:facet name="header">
                  <h:outputText value="Contrato"/>
              </f:facet>
               <center> <h:outputText value="#{o.contrato}" converter="ConverterContratoTable"/></center>
          </h:column>
           <h:column>
              <f:facet name="header">
                  <h:outputText value="Excluir"/>
              </f:facet>
              <center> <h:commandButton value="excluir" action="#{ObjFacadeObra.excluirObra}" image="../imagens/icon/excluir.gif" ></center>
                  <f:setPropertyActionListener target="#{ObjFacadeObra.obra}" value="#{o}"/>
              </h:commandButton>
          </h:column>
              <h:column>
              <f:facet name="header">
                  <h:outputText value="Alterar"/>
              </f:facet>
                  <center> <h:commandButton value="alterar" action="editar" image="../imagens/icon/alterar.gif" ></center>
                      <f:setPropertyActionListener target="#{ObjFacadeObra.obra}" value="#{o}"/>
              </h:commandButton>
          </h:column>
              <f:facet name="footer">
                  <rich:datascroller />
              </f:facet>
      </rich:dataTable>
      </h:form>
  </div><%--Table--%>
<div id="rodape"/>
</div><%--Rodapé--%>
</body>
</html>
</f:view>
